console.log('script start');//1
async function async1() {
  await async2()
  console.log('async1 end'); //去到了微任务队列//5
}
async function async2() {
  console.log('async2 end');//2
}
async1()
setTimeout(() => {
  console.log('setTimeout');//8
}, 0) 
new Promise((resolve, reject) => {
  console.log('promise');//3
  resolve()
})
.then(() => {
  console.log('then1');//6
})
.then(() => {
  console.log('then2');//7
});
console.log('script end');//4


































//script start | async1 end | promise | script end | async2end | then1 | then2 | setTimeout
//以前是上面的
//现在是下面的
//script start | async2 end | promise | script end | async1end | then1 | then2 | setTimeout

//await会先执行，但是它后面的代码都会进入微任务队列